package com.gitee.kamismile.igniteEx.common;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@ConfigurationProperties(prefix = "spring.ex-ignite")
public class IginteConfigProperties {

    private String clusterHost;
    private Integer locPort;
    private Integer ipFinderType;
    private Integer netTimeout;
    private Long sysWorkerBlockedTimeout;
    private Long failureDetectionTimeout;
    private String room;
    private List<String> members;
    private int maxPerNodeCount;
    private Integer serviceThreadPoolSize;
    private Integer systemThreadPoolSize;
    private Integer publicThreadPoolSize;
    private Integer asyncCallbackPoolSize;
    private Integer utilityCachePoolSize;
    private final Map<String, String> userAttributes = new HashMap<String, String>();
    private final Map<String, ServerProvider> servers = new HashMap<String, ServerProvider>();

    public Integer getIpFinderType() {
        return ipFinderType;
    }

    public void setIpFinderType(Integer ipFinderType) {
        this.ipFinderType = ipFinderType;
    }

    public Long getFailureDetectionTimeout() {
        return failureDetectionTimeout;
    }

    public void setFailureDetectionTimeout(Long failureDetectionTimeout) {
        this.failureDetectionTimeout = failureDetectionTimeout;
    }

    public Long getSysWorkerBlockedTimeout() {
        return sysWorkerBlockedTimeout;
    }

    public void setSysWorkerBlockedTimeout(Long sysWorkerBlockedTimeout) {
        this.sysWorkerBlockedTimeout = sysWorkerBlockedTimeout;
    }

    public Map<String, ServerProvider> getServers() {
        return servers;
    }

    public Integer getServiceThreadPoolSize() {
        return serviceThreadPoolSize;
    }

    public void setServiceThreadPoolSize(Integer serviceThreadPoolSize) {
        this.serviceThreadPoolSize = serviceThreadPoolSize;
    }

    public Integer getSystemThreadPoolSize() {
        return systemThreadPoolSize;
    }

    public void setSystemThreadPoolSize(Integer systemThreadPoolSize) {
        this.systemThreadPoolSize = systemThreadPoolSize;
    }

    public Integer getPublicThreadPoolSize() {
        return publicThreadPoolSize;
    }

    public void setPublicThreadPoolSize(Integer publicThreadPoolSize) {
        this.publicThreadPoolSize = publicThreadPoolSize;
    }

    public Integer getAsyncCallbackPoolSize() {
        return asyncCallbackPoolSize;
    }

    public void setAsyncCallbackPoolSize(Integer asyncCallbackPoolSize) {
        this.asyncCallbackPoolSize = asyncCallbackPoolSize;
    }

    public Integer getUtilityCachePoolSize() {
        return utilityCachePoolSize;
    }

    public void setUtilityCachePoolSize(Integer utilityCachePoolSize) {
        this.utilityCachePoolSize = utilityCachePoolSize;
    }

    public static class ServerProvider {
        private String serverName;
        private String serverVersion;
        private List<String> basePackages;

        public List<String> getBasePackages() {
            return basePackages;
        }

        public void setBasePackages(List<String> basePackages) {
            this.basePackages = basePackages;
        }

        public String getServerName() {
            return serverName;
        }

        public void setServerName(String serverName) {
            this.serverName = serverName;
        }

        public String getServerVersion() {
            return serverVersion;
        }

        public void setServerVersion(String serverVersion) {
            this.serverVersion = serverVersion;
        }
    }

    public Integer getLocPort() {
        return locPort;
    }

    public void setLocPort(Integer locPort) {
        this.locPort = locPort;
    }

    public Integer getNetTimeout() {
        return netTimeout;
    }

    public void setNetTimeout(Integer netTimeout) {
        this.netTimeout = netTimeout;
    }

    public Map<String, String> getUserAttributes() {
        return userAttributes;
    }

    public int getMaxPerNodeCount() {
        return maxPerNodeCount;
    }

    public void setMaxPerNodeCount(int maxPerNodeCount) {
        this.maxPerNodeCount = maxPerNodeCount;
    }

    public String getClusterHost() {
        return clusterHost;
    }

    public void setClusterHost(String clusterHost) {
        this.clusterHost = clusterHost;
    }

    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    public List<String> getMembers() {
        return members;
    }

    public void setMembers(List<String> members) {
        this.members = members;
    }
}
